//
//  UMStoreManager.h
//  YRSideViewController
//
//  Created by xiabin on 14/12/29.
//  Copyright (c) 2014年 YueRuo. All rights reserved.

//  UMNetworkManager
//  UM网络连接统一接口

#import <Foundation/Foundation.h>
#import "JobDelegate.h"
#import "ServerCodecDef.h"

typedef enum {
    GetCityInfoJob = 1,
    GetDyncPwdJob = 2,
    Login = 3,
    RegUser = 4,
    JobPostsByCategoryId = 5,
    JobGetPostByPostId = 6,
    JobGetCommentsByPostId = 7,
    JobPublishPost = 8,
    JobDoFav = 9,
    JobPublishComment = 10,
    JobGetProduct = 11,
    JobGetTopic = 12,
    JobGetCommentsByProductId = 13,
    JobAddShoppingCark = 14,
    JobSaveAddress = 15,
    JobSubmitOrder = 16,
    JobGetIMLoginToken = 17,
    JobGetIMUsersInfo = 18,
    JobGetIMGroups = 19,
    JobGetIMChatRoom = 20,
    JobGetMyComments = 21,
    JobGetMyLikes = 22,
    JobGetFollowers = 23,
    JobGetFans = 24,
    JobGetOrders = 25,
    JobGetUserCard = 26,
    JobGetSelfInfo = 27,
    JobGetUserPosts = 28,
    JobFollowUser = 29,
    JobUpdateHead = 30,
    JobUpdateField = 31,
    JobGetProductDetail = 32,
    JobGetTopicCellsProduct = 33,
    JobFollowProduct = 34,
    JobUnFollowProduct = 35,
    JobGetFollowProducts = 36,
    JobAddBuket = 37,
    JobDellBuket = 38,
    JobGetBuketList = 39,
    JobReportPost = 40,
    JobBindBDPush = 41,
    JobGettingSetting = 42,
    JobUpdateSettting = 43,
    JobConfirmOrder = 44,
    JobReviewProduct = 45,
    Job3rdLogin = 46,
    JobGetProductSingle = 47,
} NetWorkJobType;

@interface UMNetworkManager : NSObject
{
    int jobcookie;
    int uid;
    NSString* curVersion;
}

#define QGNetworkManager [UMNetworkManager sharedInstance]
+(UMNetworkManager*)sharedInstance;

-(void) initManager;
//新版本协议
-(int) GetCityInfo:(NSString*)cityName Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetPwd:(NSString*)phoneNumber Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) LoginWithNameAndPwd:(NSMutableData*)userinfo Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) ThirdPartyLogin:(NSString*)openId Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) RegUserNick:(NSString*)userNick Gender:(int)genderId HeadData:(NSData*)imagedata Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetPostsCategory:(int) timeStamp Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetPostsByCategoryId:(int)CategoryId WithPageNum:(int)PageNum LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetPostByPostId:(int)PostId LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetCommentsByPostId:(int)PostId WithPageNum:(int)PageNum LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) PublishPost:(NSString*)title Category:(int)CategoryId Content:(NSString*) content ImageDatas:(NSArray*)imagedata Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) DoFavorPost:(int)postID Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) DoFollowUser:(int)userId Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) DoUnFollowUser:(int)userId Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) PublishComment:(int)PostId Content:(NSString*) content replyUid:(int) toUid replyComment:(int) toCommentID ImageDatas:(NSData*)imagedata Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetProductHomeCallback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetProductHomeSingleProductCallback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetProductDetail:(int)ProductID withTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetTopicSellsProducts:(int)TopicID withTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetTopicHomeLastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetCommentsByProductId:(int)ProductId WithPageIdx:(int)PageIdx LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) UpdateShoppingCartItemsStatus:(NSMutableData*)productInfo SetCallback:(id<UMAsyncJobDelegate>)JobDelegate;

-(int) SaveAddressInfo:(NSMutableData*)AddressInfo Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) SubmitOrder:(NSMutableData*)OrderInfo Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetIMLoginTokenCallback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) GetIMUsersInfo:(NSArray*)users Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetIMGroupsCallback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetIMChatrooms:(int) ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetMyCommentsByUIdWithPageIdx:(int)PageIdx LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetMyLikesByUIdWithPageIdx:(int)PageIdx LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetUserFollowsUID:(int)UserID andPage:(int)PageIdx LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetUserFansUID:(int)UserID andPage:(int)PageIdx LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetOrderInStatus:(int)status Page:(int)PageIdx LastTS:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) GetUserCard:(int)targetUid LastTs:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetSelfInfoLastTs:(int)ts Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetUserPosts:(int)targetUid Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) UpdateHead:(NSData*)imagedata Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) UpdateUserInfo:(NSDictionary*)infoData Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) FollowProduct:(int)productID Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) UnFollowProducts:(NSArray*)productsIDArr Callback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) GetFollowProduct:(int)pgIndex pgSize:(int) pgSize Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) ReportPosts:(int)postId Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) BindBDPush:(NSString*)channelId Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) GetSettingCallback: (id<UMAsyncJobDelegate>)JobDelegate;
-(int) UpdateSetting:(NSString*) type Value:(int) v Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) ReviewProduct:(NSString*) content ProductId:(int) pid Scroll:(double) sc Callback: (id<UMAsyncJobDelegate>)JobDelegate;

-(int) ConfirmOrder:(int) orderId Callback:(id<UMAsyncJobDelegate>)JobDelegate;

@end
